// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	2/26/2015 6:01:53 PM				
// -----------------------------

#ifndef _File_h
#define _File_h

#include "Common.h"

namespace Flow
{

	class FilePackage;

	class File
	{
	public:

		friend class FilePackage;

		void			Open();
		void			Close();

		void*			ReadAllData();
		void			ReadAllData(void* lpDataOutput);

		void			Read(void* lpData, Size_T dataSize) const;

		void			SetPosition(Size_T position) const;
		void			ResetPosition() const;

		FilePackage*	GetPackage() const;
		const tstring&	GetName() const;
		UInt64			GetDataStart() const;
		UInt64			GetDataSize() const;
		Bool			IsOpen() const;

	private:

		File(FilePackage* lpPackage, const tstring& fileName, UInt64 dataStart, UInt64 dataSize);
		~File();

		FilePackage*	m_lpPackage;

		tstring			m_FileName;
		UInt64			m_DataStart;
		UInt64			m_DataSize;

		Bool			m_IsOpen;

		File(const File& refFile);
		File& operator=(const File& refFile);
	};

}

#endif